Type Definitions

The following type definitions are available globally.

  • A callback block for RLMObject notifications.

    If the object is deleted from the managing Realm, the block is called with deleted set to YES and the other two arguments are nil. The block will never be called again after this.

    If the object is modified, the block will be called with deleted set to NO, a nil error, and an array of RLMPropertyChange objects which indicate which properties of the objects were modified.

    If an error occurs, deleted will be NO, changes will be nil, and error will include information about the error. The block will never be called again after an error occurs.

    Declaration

    Objective-C

    typedef void (^RLMObjectChangeBlock)(BOOL,
                                         NSArray<RLMPropertyChange *> *_Nullable,
                                         NSError *_Nullable)

    Swift

    typealias RLMObjectChangeBlock = (Bool, [RLMPropertyChange]?, Error?) -> Void
  • A block type representing a block which can be used to report a sync-related error to the application. If the error pertains to a specific session, that session will also be passed into the block.

    Declaration

    Objective-C

    typedef void (^RLMSyncErrorReportingBlock)(NSError *_Nonnull,
                                               RLMSyncSession *_Nullable)

    Swift

    typealias RLMSyncErrorReportingBlock = (Error, RLMSyncSession?) -> Void
  • The type of a progress notification block intended for reporting a session’s network activity to the user.

    transferredBytes refers to the number of bytes that have been uploaded or downloaded. transferrableBytes refers to the total number of bytes transferred, and pending transfer.

    Declaration

    Objective-C

    typedef void (^RLMProgressNotificationBlock)(NSUInteger, NSUInteger)

    Swift

    typealias RLMProgressNotificationBlock = (UInt, UInt) -> Void
  • A block type used for APIs which asynchronously vend an RLMSyncUser.

    Declaration

    Objective-C

    typedef void (^RLMUserCompletionBlock)(RLMSyncUser *_Nullable,
                                           NSError *_Nullable)

    Swift

    typealias RLMUserCompletionBlock = (RLMSyncUser?, Error?) -> Void
  • A block type used to report the status of a password change operation. If the NSError argument is nil, the operation succeeded.

    Declaration

    Objective-C

    typedef void (^RLMPasswordChangeStatusBlock)(NSError *_Nullable)

    Swift

    typealias RLMPasswordChangeStatusBlock = (Error?) -> Void
  • A block type used to report the status of a permission apply or revoke operation. If the NSError argument is nil, the operation succeeded.

    Declaration

    Objective-C

    typedef void (^RLMPermissionStatusBlock)(NSError *_Nullable)

    Swift

    typealias RLMPermissionStatusBlock = (Error?) -> Void
  • A block type used to report the status of a permission offer operation.

    Declaration

    Objective-C

    typedef void (^RLMPermissionOfferStatusBlock)(NSString *_Nullable,
                                                  NSError *_Nullable)

    Swift

    typealias RLMPermissionOfferStatusBlock = (String?, Error?) -> Void
  • A block type used to report the status of a permission offer response operation.

    Declaration

    Objective-C

    typedef void (^RLMPermissionOfferResponseStatusBlock)(NSURL *_Nullable,
                                                          NSError *_Nullable)

    Swift

    typealias RLMPermissionOfferResponseStatusBlock = (URL?, Error?) -> Void
  • A block type used to asynchronously report results of a permissions get operation. Exactly one of the two arguments will be populated.

    Declaration

    Objective-C

    typedef void (^RLMPermissionResultsBlock)(
        RLMResults<RLMSyncPermission *> *_Nullable, NSError *_Nullable)

    Swift

    typealias RLMPermissionResultsBlock = (RLMResults<RLMSyncPermission>?, Error?) -> Void
  • A block type used to asynchronously report results of a user info retrieval. Exactly one of the two arguments will be populated.

    Declaration

    Objective-C

    typedef void (^RLMRetrieveUserBlock)(RLMSyncUserInfo *_Nullable,
                                         NSError *_Nullable)

    Swift

    typealias RLMRetrieveUserBlock = (RLMSyncUserInfo?, Error?) -> Void
  • A block type used to report an error related to a specific user.

    Declaration

    Objective-C

    typedef void (^RLMUserErrorReportingBlock)(RLMSyncUser *_Nonnull,
                                               NSError *_Nonnull)

    Swift

    typealias RLMUserErrorReportingBlock = (RLMSyncUser, Error) -> Void
  • A token originating from the Realm Object Server.

    Declaration

    Objective-C

    typedef NSString *RLMServerToken

    Swift

    typealias RLMServerToken = NSString
  • A notification indicating that changes were made to a Realm.

    Declaration

    Objective-C

    typedef NSString *RLMNotification
  • A block called when opening a Realm for the first time during the life of a process to determine if it should be compacted before being returned to the user. It is passed the total file size (data + free space) and the total bytes used by data in the file.

    Return YES to indicate that an attempt to compact the file should be made. The compaction will be skipped if another process is accessing it.

    Declaration

    Objective-C

    typedef BOOL (^RLMShouldCompactOnLaunchBlock)(NSUInteger, NSUInteger)
  • A property on which a RLMResults<RLMSyncPermission *> can be queried or filtered.

    Warning

    If building NSPredicates using format strings including these string constants, use %K instead of %@ as the substitution parameter.

    Declaration

    Objective-C

    typedef NSString *RLMSyncPermissionSortProperty